<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/production/production/Production_PurchaseOrder.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/production/production/Production_PurchaseOrder.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'PolList_Id',
                footer: "Foots",
                cnName: '采购单',
                name: 'production/Production_PurchaseOrder',
                url: "/Production_PurchaseOrder/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({"InvCode":"","InvName":"","Supplier":"","TaxRate":"","UnitPrice":"","Price":"","Qty":"","DeliveryDate":"","ReqList_Id":"","PoCode":""});
            const editFormOptions = ref([[{"title":"物料编码","required":true,"field":"InvCode","disabled":true,"type":"text"},
                               {"dataKey":"productList","data":[],"title":"物料名称","field":"InvName","disabled":true,"type":"select"}],
                              [{"dataKey":"Supplier","data":[],"title":"供应商","field":"Supplier","disabled":true,"type":"select"},
                               {"title":"税率","field":"TaxRate","disabled":true,"type":"decimal"}],
                              [{"title":"含税单价","field":"UnitPrice","type":"decimal"},
                               {"title":"未税单价","field":"Price","type":"decimal"}],
                              [{"title":"需求数量","required":true,"field":"Qty","type":"number"},
                               {"title":"交货日期","field":"DeliveryDate","type":"date"}],
                              [{"title":"需求单ID","required":true,"field":"ReqList_Id","disabled":true},
                               {"title":"采购单号","required":true,"field":"PoCode"}]]);
            const searchFormFields = ref({"PoCode":"","InvCode":"","InvName":"","Supplier":"","Status":""});
            const searchFormOptions = ref([[{"title":"采购单号","field":"PoCode","type":"text"},{"title":"物料编码","field":"InvCode","type":"text"}],[{"dataKey":"productList","data":[],"title":"物料名称","field":"InvName","type":"text"},{"dataKey":"Supplier","data":[],"title":"供应商","field":"Supplier","type":"text"}],[{"dataKey":"overStatus","data":[],"title":"状态","field":"Status","type":"radio"}]]);
            const columns = ref([{field:'PolList_Id',title:'PolList_Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ReqList_Id',title:'需求单ID',type:'string',width:180,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'PoCode',title:'采购单号',type:'string',width:220,require:true,align:'left',sort:true},
                       {field:'InvCode',title:'物料编码',type:'string',link:true,width:180,readonly:true,require:true,align:'left'},
                       {field:'InvName',title:'物料名称',type:'string',bind:{ key:'productList',data:[]},width:180,readonly:true,align:'left'},
                       {field:'InvStandard',title:'物料规格',type:'string',width:180,align:'left'},
                       {field:'Supplier',title:'供应商',type:'string',bind:{ key:'Supplier',data:[]},width:180,readonly:true,align:'left'},
                       {field:'Currency',title:'币别',type:'string',bind:{ key:'Currency',data:[]},width:80,align:'left'},
                       {field:'ExchangeRate',title:'汇率',type:'decimal',width:110,align:'left'},
                       {field:'TaxRate',title:'税率',type:'float',width:110,readonly:true,align:'left'},
                       {field:'UnitPrice',title:'含税单价',type:'decimal',width:110,align:'left'},
                       {field:'Price',title:'未税单价',type:'decimal',width:110,align:'left'},
                       {field:'Qty',title:'需求数量',type:'int',width:110,require:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'},
                       {field:'Modifier',title:'Modifier',type:'string',width:130,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:110,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'VerifyId',title:'VerifyId',type:'string',width:180,hidden:true,align:'left'},
                       {field:'VerifyDate',title:'审核时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'Verifier',title:'审核人',type:'string',width:110,align:'left'},
                       {field:'Status',title:'状态',type:'int',bind:{ key:'overStatus',data:[]},width:110,align:'left'},
                       {field:'InQnty',title:'InQnty',type:'int',width:80,hidden:true,align:'left'},
                       {field:'DeliveryDate',title:'交货日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Unit',title:'单位',type:'string',width:120,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
